﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="EZCRS.HCMS.Web.manage.carduser.upgrade_list" Codebehind="upgrade_list.aspx.cs" %>

<%@ Register Src="../usercontrol/titlepage.ascx" TagName="titlepage" TagPrefix="uc2" %>
<%@ Register Src="../usercontrol/jspage.ascx" TagName="jspage" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="../../Common/base_grid.js" language="javascript" type="text/javascript"></script>
    <script src="../../common/calendar1.js" language="javascript" type="text/javascript"></script>

</head>
<body onload="Page_Load('First');">
    <form id="form1" runat="server">
    <uc2:titlepage ID="Titlepage1" runat="server" inittitle="<%$ Resources:Site , LabCardUpgrade %>">
    </uc2:titlepage>
    <table class="main-table" cellpadding="1" cellspacing="1">
        <tr class="line-even">
            <td width="17%" style="width: 10%; text-align: right;">
                <asp:Label runat="server" ID="Label1" Text="<%$ Resources:Site, LabDate %>"></asp:Label>：
            </td>
            <td width="32%" style="width: 30%; text-align: left;">
                <input id="bstart" class="text-line" style="width: 100px" type="text" runat="server"
                    value="yyyy-MM-dd" />&nbsp;-
                <input id="bend" class="text-line" style="width: 100px" type="text" runat="server"
                    value="yyyy-MM-dd" />
                &nbsp;
                <asp:Button ID="BtnSearch" runat="server" CssClass="bttn" OnClientClick="javascript:Page_Load('Search');return false;"
                    Text="<%$ Resources:Site, ButtonSearch %>" />
            </td>
            <td width="21%" style="width: 20%">
            </td>
        </tr>
    </table>
    <br />
    <div class="mid">
    <div class="optbar">
        <a href="javascript:sdel();" class="blue" onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#B9CEEA';"
            onmouseout="this.style.backgroundColor=currentcolor;">
            <img src="../../image/delete.gif" border="0" />
            <asp:Literal ID="Label3" runat="server" Text="<%$ Resources:Site, LabDelete %>"></asp:Literal></a>&nbsp;
        <a href="javascript:supgrade();" class="blue" onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#B9CEEA';"
            onmouseout="this.style.backgroundColor=currentcolor;">
            <img src="../../image/save.gif" border="0" />
            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Site, LabUpgrade %>"></asp:Literal></a>
    </div>
    <input type="hidden" id="orderkey" value="0" /><input type="hidden" id="txt_sql"
        value="" />
    </form>
    <uc1:jspage ID="Jspage1" runat="server"></uc1:jspage>
</div>
    <script type="text/javascript">
        function Page_Load(pageindex) {//debugger
            var sstr = "";
            sstr += $FDate("bstart") + "|";
            sstr += $FDate("bend");
            pageindex = pageIndexSetting(pageindex);    //pageindex的设定
            EZCRS.HCMS.myajax.CardUserUpgrade.userlist(pageindex, sstr, $F('orderkey').value, setTable);
            pageLastSetting(sstr, pageindex);     //最后的赋值 
        }

        function setorders(orderstr) {
            if ($F("orderkey").value == orderstr) {
                $F("orderkey").value = orderstr + orderstr;
            }
            else {
                $F("orderkey").value = orderstr;
            }
            Page_Load("First");
        }

        function sdel() {
            if (!confirm("<%= Resources.Site.ScriptConfirm %>"))
                return;

            var logidlist = $F("hidlogid").value.split(',');
            var dellogid = "";
            for (i = 0; i < logidlist.length; i++) {
                if ($F("cbx" + logidlist[i]).checked)
                { dellogid += "," + logidlist[i]; }
            }
            EZCRS.HCMS.myajax.CardUserUpgrade.userdel(dellogid, delresp);
        }

        function delresp(resp) {
            if (resp.value == "1") {
                alert("<%= Resources.Site.ScriptDelSuccess %>");
                Page_Load("First");
            }
            else
            { alert("<%= Resources.Site.ScriptDelFalse %>"); }
        }

        function supgrade() {
            if (!confirm("<%= Resources.Site.ScriptConfirm %>"))
                return;

            var logidlist = $F("hidlogid").value.split(',');
            var uplogid = "";
            for (i = 0; i < logidlist.length; i++) {
                if ($F("cbx" + logidlist[i]).checked)
                { uplogid += "," + logidlist[i]; }
            }
            EZCRS.HCMS.myajax.CardUserUpgrade.userupgrade(uplogid, upresp);
        }

        function upresp(resp) {
            if (resp.value == "0")
            { alert("<%= Resources.Site.ScriptActionFalse %>"); }
            else {
                alert(resp.value + "<%= Resources.Site.ScriptCardUpgrade %>");
                Page_Load("First");
            }
        }

        AjaxPro.timeoutPeriod = 40000;
        var l = $F("loadinfo");
        AjaxPro.onLoading = function(b) {
            l.innerHTML = "<img src=\"../../Image/loading.gif\" alt=\"Loading\" align=\"absmiddle\" /><%= Resources.Site.LabLoadInfo %>";
        }
        AjaxPro.onError = function(e) {
            l.innerHTML = "<%= Resources.Site.LabLoadErrInfo %>";
        }
        AjaxPro.onTimeout = function(t) {
            l.innerHTML = "<%= Resources.Site.LabLoadErrInfo %>";
        }
    
    
    </script>

</body>
</html>
